<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Tetris: piece.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Tetris
   
   </div>
   <div id="projectbrief">Um jogo do tipo tetris</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
<div class="header">
  <div class="headertitle">
<div class="title">piece.h</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 ﻿#ifndef PIECE_H
<a name="l00002"></a>00002 <span class="preprocessor">#define PIECE_H</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include &lt;QSize&gt;</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include &lt;QPoint&gt;</span>
<a name="l00018"></a>00018 <span class="preprocessor">#include &lt;QRect&gt;</span>
<a name="l00019"></a>00019 <span class="preprocessor">#include &lt;QList&gt;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;QString&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;QTransform&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;QColor&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;QDebug&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;qmath.h&gt;</span>
<a name="l00025"></a>00025 
<a name="l00026"></a><a class="code" href="class_piece.html">00026</a> <span class="keyword">class </span><a class="code" href="class_piece.html" title="Classe abstrata do tipo Piece.">Piece</a>
<a name="l00027"></a>00027 {
<a name="l00028"></a>00028 <span class="keyword">public</span>:
<a name="l00032"></a>00032     <a class="code" href="class_piece.html#ac57de5803bbad829b143bc7268267dc1" title="Construtor padrão classe abstrata Piece.">Piece</a>();
<a name="l00036"></a>00036     ~<a class="code" href="class_piece.html" title="Classe abstrata do tipo Piece.">Piece</a>();
<a name="l00044"></a>00044     <span class="keyword">virtual</span> QList&lt;QRect&gt; <a class="code" href="class_piece.html#a99eb401422a1788143851650d3cddb8b" title="Função virtual pura da classe abstrata Piece para rotacionar as peças de cada tipo. As funções de rotação estão implemetadas nas classes derivadas de Piece.">rotacione</a>()=0;
<a name="l00050"></a><a class="code" href="class_piece.html#ad61e09e20b7a542f21cfcf6d55dcbd08">00050</a>     QList&lt;QRect&gt; <a class="code" href="class_piece.html#ad61e09e20b7a542f21cfcf6d55dcbd08" title="Função membro pública da classe abstrata Piece para obter a lista de quadrados de cada peça...">getQuadrados</a>() {<span class="keywordflow">return</span> <a class="code" href="class_piece.html#a6d49bc83e538a28c53e2580c53cdcc4c">m_Quadrados</a>;}
<a name="l00057"></a><a class="code" href="class_piece.html#ab22a45578fda92f818577db2a010c4b0">00057</a>     QRect <a class="code" href="class_piece.html#ab22a45578fda92f818577db2a010c4b0" title="Função membro pública da classe abstrata Piece para obter um dos quadrados de cada peça...">getQuadrado</a>(<span class="keywordtype">int</span> n) {<span class="keywordflow">return</span> <a class="code" href="class_piece.html#a6d49bc83e538a28c53e2580c53cdcc4c">m_Quadrados</a>[n];}
<a name="l00063"></a><a class="code" href="class_piece.html#aa9daf40969bca1f1eae82e194913f9f5">00063</a>     <span class="keywordtype">int</span> <a class="code" href="class_piece.html#aa9daf40969bca1f1eae82e194913f9f5" title="Função membro pública da classe abstrata Piece para obter o número inteiro de quadrados de cada peça...">getQuadCount</a>() {<span class="keywordflow">return</span> <a class="code" href="class_piece.html#a6d49bc83e538a28c53e2580c53cdcc4c">m_Quadrados</a>.size();}
<a name="l00069"></a><a class="code" href="class_piece.html#a67caf3ea898bc630e80e769d891a2ed6">00069</a>     QColor <a class="code" href="class_piece.html#a67caf3ea898bc630e80e769d891a2ed6" title="Função membro pública da classe abstrata Piece para obter a propriedade de cor de cada peça...">getColor</a>(){<span class="keywordflow">return</span> <a class="code" href="class_piece.html#a8d1f6e8e33efc4e0c54ce6e8dbd45d1f">m_Cor</a>;}
<a name="l00076"></a>00076     <span class="keywordtype">void</span> <a class="code" href="class_piece.html#a76bf182dcf010bb7d5434054a8f79d13" title="Função membro pública da classe abstrata Piece para modificar todos os quadrados de uma peça...">setQuadrados</a>(QList&lt;QRect&gt; quads);
<a name="l00084"></a>00084     <span class="keywordtype">void</span> <a class="code" href="class_piece.html#a56e30591ed76581f17f0cd6f07e161a7" title="Função membro pública da classe abstrata Piece para movimentar todos os quadrados de uma peça para es...">moveRight</a>();
<a name="l00092"></a>00092     <span class="keywordtype">void</span> <a class="code" href="class_piece.html#a686e43e7dd6de32eca123461db4cde7e" title="Função membro pública da classe abstrata Piece para movimentar todos os quadrados de uma peça para es...">moveLeft</a>();
<a name="l00100"></a>00100     <span class="keywordtype">void</span> <a class="code" href="class_piece.html#ac5b9ca1161164766674cf7f9ab25b849" title="Função membro pública da classe abstrata Piece para movimentar todos os quadrados de uma peça para ba...">moveDown</a>();
<a name="l00108"></a>00108     <span class="keywordtype">void</span> <a class="code" href="class_piece.html#a605af161a4ad16ad864378895e190e4d" title="Função membro pública da classe abstrata Piece para centralizar o eixo horizontal de uma peça qualque...">centerPieceWidth</a>(<span class="keywordtype">int</span> w);
<a name="l00116"></a>00116     <span class="keywordtype">void</span> <a class="code" href="class_piece.html#a33ac0f4e1be92c4be45d845bbcd092e7" title="Função membro pública da classe abstrata Piece para centralizar o eixo vertical de uma peça qualquer ...">centerPieceHeight</a>(<span class="keywordtype">int</span> h);
<a name="l00122"></a><a class="code" href="class_piece.html#a4d666acde7e3714a2b63f54e5b764454">00122</a>     <span class="keyword">static</span> QSize <a class="code" href="class_piece.html#a4d666acde7e3714a2b63f54e5b764454" title="Função membro pública da classe abstrata Piece para obter a propriedade estática de tamanho dos quadr...">getQuadLength</a>() {<span class="keywordflow">return</span> <a class="code" href="class_piece.html#a66a4ab4f2d8e917dc2045c2617a30824">s_QuadLength</a>;}
<a name="l00123"></a>00123 <span class="keyword">protected</span>:
<a name="l00124"></a><a class="code" href="class_piece.html#a66a4ab4f2d8e917dc2045c2617a30824">00124</a>     <span class="keyword">static</span> <span class="keyword">const</span> QSize <a class="code" href="class_piece.html#a66a4ab4f2d8e917dc2045c2617a30824">s_QuadLength</a>;    
<a name="l00127"></a><a class="code" href="class_piece.html#a6d49bc83e538a28c53e2580c53cdcc4c">00127</a>     QList&lt;QRect&gt; <a class="code" href="class_piece.html#a6d49bc83e538a28c53e2580c53cdcc4c">m_Quadrados</a>;           
<a name="l00130"></a><a class="code" href="class_piece.html#a8d1f6e8e33efc4e0c54ce6e8dbd45d1f">00130</a>     QColor <a class="code" href="class_piece.html#a8d1f6e8e33efc4e0c54ce6e8dbd45d1f">m_Cor</a>;                       
<a name="l00133"></a><a class="code" href="class_piece.html#a5b3e167dbdcc4896754b6688fab1c001">00133</a>     <span class="keywordtype">bool</span> <a class="code" href="class_piece.html#a5b3e167dbdcc4896754b6688fab1c001">m_Rot</a>;                         
<a name="l00137"></a><a class="code" href="class_piece.html#a8622d4c102e4f95ef398b05efe0e1c73">00137</a>     <span class="keywordtype">bool</span> <a class="code" href="class_piece.html#a8622d4c102e4f95ef398b05efe0e1c73">m_TriedRot</a>;                    
<a name="l00141"></a>00141 };
<a name="l00142"></a>00142 
<a name="l00143"></a>00143 <span class="preprocessor">#endif // PIECE_H</span>
</pre></div></div>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Variables</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Tue Nov 29 2011 12:33:35 for Tetris by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.5.1
</small></address>

</body>
</html>
